#!/usr/bin/env python


def configure(conf):
	pass


def build(bld):
	import os
	obj = bld(
		features = ['c', bld.env['CLIBTYPE']],
		includes = ['.', '../..'],
		uselib = bld.env['COMMON_USELIB'],
		target = 'gstimxcommon',
		vnum = bld.env['GSTIMX_VERSION'],
		source = bld.path.ant_glob('*.c')
	)
	if bld.env['BUILD_FOR_ANDROID']:
		obj.install_path = os.path.join(bld.env['PREFIX'], 'lib')

	bld(
		source = 'gstimxcommon.pc.in',
		target = 'gstimxcommon.pc',
		VERSION = bld.env['GSTIMX_VERSION'],
        LIBS = '-lgstimxcommon',
		CFLAGS = '-Wall'
	)

	bld.install_files('${PREFIX}/include/gstreamer-1.0/gst/allocators/imx', 'phys_mem_allocator.h')
	bld.install_files('${PREFIX}/include/gstreamer-1.0/gst/allocators/imx', 'phys_mem_addr.h')
	bld.install_files('${PREFIX}/include/gstreamer-1.0/gst/allocators/imx', 'phys_mem_meta.h')
